


<!DOCTYPE html>
<html id="htmlId">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
  <title>Coverage Report > SquareTest</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">nl.tudelft.jpacman.board</a>
</div>

<h1>Coverage Summary for Class: SquareTest (nl.tudelft.jpacman.board)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">SquareTest</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/5)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/14)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package nl.tudelft.jpacman.board;
&nbsp;
&nbsp;import org.junit.jupiter.api.BeforeEach;
&nbsp;import org.junit.jupiter.api.Test;
&nbsp;
&nbsp;import static org.assertj.core.api.Assertions.assertThat;
&nbsp;import static org.mockito.Mockito.mock;
&nbsp;
&nbsp;/**
&nbsp; * Test suite to confirm the public API of {@link Square} works as desired.
&nbsp; *
&nbsp; * @author Jeroen Roosen 
&nbsp; */
<b class="nc">&nbsp;class SquareTest {</b>
&nbsp;
&nbsp;    /**
&nbsp;     * The square under test.
&nbsp;     */
&nbsp;    private Square square;
&nbsp;
&nbsp;    /**
&nbsp;     * Resets the square under test.
&nbsp;     */
&nbsp;    @BeforeEach
&nbsp;    void setUp() {
<b class="nc">&nbsp;        square = new BasicSquare();</b>
&nbsp;    }
&nbsp;
&nbsp;    /**
&nbsp;     * Assert that the square holds the occupant once it has occupied it.
&nbsp;     */
&nbsp;    @Test
&nbsp;    void testOccupy() {
<b class="nc">&nbsp;        Unit occupant = mock(Unit.class);</b>
<b class="nc">&nbsp;        square.put(occupant);</b>
&nbsp;
<b class="nc">&nbsp;        assertThat(square.getOccupants()).contains(occupant);</b>
&nbsp;    }
&nbsp;
&nbsp;    /**
&nbsp;     * Assert that the square no longer holds the occupant after it has left the
&nbsp;     * square.
&nbsp;     */
&nbsp;    @Test
&nbsp;    void testLeave() {
<b class="nc">&nbsp;        Unit occupant = mock(Unit.class);</b>
<b class="nc">&nbsp;        square.put(occupant);</b>
<b class="nc">&nbsp;        square.remove(occupant);</b>
&nbsp;
<b class="nc">&nbsp;        assertThat(square.getOccupants()).doesNotContain(occupant);</b>
&nbsp;    }
&nbsp;
&nbsp;    /**
&nbsp;     * Assert that the order in which units entered the square is preserved.
&nbsp;     */
&nbsp;    @Test
&nbsp;    void testOrder() {
<b class="nc">&nbsp;        Unit o1 = mock(Unit.class);</b>
<b class="nc">&nbsp;        Unit o2 = mock(Unit.class);</b>
<b class="nc">&nbsp;        square.put(o1);</b>
<b class="nc">&nbsp;        square.put(o2);</b>
&nbsp;
<b class="nc">&nbsp;        assertThat(square.getOccupants()).containsSequence(o1, o2);</b>
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2024-05-05 10:29</div>
</div>
</body>
</html>
